package cn.bigcypress.controller;

import cn.bigcypress.common.base.ServerResponse;
import cn.bigcypress.service.CommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/*生成七牛云token*/
@Api(tags = "七牛云token")
@RestController
@RequestMapping("/upload/token")
public class QiNiuTokenController {

    @Resource
    private CommonService commonService;

    @ApiOperation(value = "七牛云获取token")
    @GetMapping
    public ServerResponse<String> generateUploadToken() {
        return commonService.getQiniuUploadToken();
    }

}
